import React from 'react';


//1.jsx实现if语句
const App=()=>{
    let n=2
    return n%2===0?<div>oushu</div>:<div>jishu</div>
}

const App1=()=>{
    let n=3
    return(
        <div>
            {n%2===0?<div>oushu</div>:<div>jishu</div>}
        </div>
    )
}

const App2=()=>{
    let n=3
    const content=(
        <div>
            {n%2===0?<div>oushu</div>:<div>jishu</div>}
        </div>
    )
    return content
}

const App3=()=>{
    let n=3
    const inner=n%2===0?<div>oushu</div>:<div>jishu</div>
    const content=(
        <div>
            {inner}
        </div>
    )
    return content
}

const App4=()=>{
    let n=3
    let inner
    if(n%2===0){
        inner=<div>oushu</div>
    }else {
        inner=<div>jishu</div>
    }
    const content=(
        <div>
            {inner}
        </div>
    )
    return content
}

//2.jsx实现loop语句

const Bpp=(props)=>{
    props.numbers.map(
        (n,index)=>{ return <div>{index}个的值为{n}</div>}
    )
}

const Bpp1=(props)=>{
    return(
        <div>
            {
                props.numbers.map((n,index)=>{return <div>{index}的值为{n}</div>})
            }
        </div>
    )
}

const Bpp2=(props)=>{
    let array
    for (let i=0;i<props.numbers.length;i++){
        array.push(<div>下标{i}的值为{props.numbers[i]}</div>)
    }
    return <div>{array}</div>
}

export default App